﻿package generalManagerLogic;


import java.rmi.RemoteException;

import logicInterface.GeneralManagerLogicInterface;
import vo.generalManager.GivePanelVO;
import vo.generalManager.LoginPanelVO;
import vo.generalManager.PromotionPanelVO;
import vo.generalManager.TicketPanelVO;

public class MockGeneralManagerLogic implements GeneralManagerLogicInterface{
	private  LoginPanelVO lpvo;
	private  PromotionPanelVO ppvo;
	private  TicketPanelVO tpvo;
	private  GivePanelVO gpvo;
	
	private String state;
	private String message;
	
	public MockGeneralManagerLogic(){
		lpvo=new LoginPanelVO();
		ppvo=new PromotionPanelVO();
		tpvo=new TicketPanelVO();
		gpvo=new GivePanelVO();
		
		state="Login";
		message="";
	}

	public LoginPanelVO getLpvo() {
		return lpvo;
	}

	public void setLpvo(LoginPanelVO lpvo) {
		this.lpvo = lpvo;
	}

	public PromotionPanelVO getPpvo() {
		return ppvo;
	}

	public void setPpvo(PromotionPanelVO ppvo) {
		this.ppvo = ppvo;
	}

	public TicketPanelVO getTpvo() {
		return tpvo;
	}

	public void setTpvo(TicketPanelVO tpvo) {
		this.tpvo = tpvo;
	}

	public GivePanelVO getGpvo() {
		return gpvo;
	}

	public void setGpvo(GivePanelVO gpvo) {
		this.gpvo = gpvo;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@Override
	public String login() throws RemoteException {
		state="Main";
		return state;
	}

	@Override
	public String logout() throws RemoteException {
		state="Login";
		return state;
	}

	@Override
	public String toSetPromotion() throws RemoteException {
		state="Promotion";
		return state;
	}

	@Override
	public String toSetSalesStrategy() throws RemoteException {
		state="Ticket";
		return state;
	}

	@Override
	public String toMain() throws RemoteException {
		state="Main";
		return state;
	}

	@Override
	public String setPromotion() throws RemoteException {
		message="设置成功!";
		state="Promotion";
		return state;
	}

	@Override
	public String searchCustomer() throws RemoteException {
		state="Ticket";
		String[][] data={{"aaa","11"},{"aaa","11"}};
		tpvo.setUserData(data);
		return state;
	}

	@Override
	public String toGive() throws RemoteException {
		message="";
		if(tpvo.getSelectedRow()==-1){
			message="请选中所要修改的行！";
		}else{
			state="Give";
		}
		return state;
	}

	@Override
	public String give() throws RemoteException {
		message="赠送成功";
	    return state;
	}

	@Override
	public String toTicket() throws RemoteException {
		state="Ticket";
		return state;
	}
	
	
	
}
